﻿<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>快来运科技</title>
    <meta content="" name="keywords">
    <meta content="" name="description">
    @Styles.Render("~/Content/css")
    <link href="~/Content/PagedList.css" rel="stylesheet" />
</head>
<body>
    <div class="header">
        <div class="info">
            <span class="fl">
                <a href="/account/login">货主登录</a>
                <a href="/account/register" class="on">免费注册</a>
            </span>
            <span class="fr">
                <span id="display"></span><span id="logoutSpan"> / <a href="#" id="logout">退出登录</a></span><a href="/home/index">快来运首页</a> | <a href="/home/join">快来运加盟</a>
            </span>
        </div>
    </div>

    <div class="navlist">
        <a href="/home/index" class="logo fl">快来运科技</a>
        <span class="fr" id="navigate">
            <a href="/home/index" class="on" rel="index">首页</a>
            <a href="/Freight/zhengche" rel="zhengce">整车</a>
            <a href="/Freight/Vipline" rel="vipline">专线</a>
            <a href="/Logistics/index" rel="logistics">物流公司</a>
            <a href="/home/quickrun" rel="quickrun">快来云APP <i></i></a>
            <a href="/home/join" rel="join">加盟</a>
            <a href="/home/about" rel="about">关于我们</a>
            <a href="/News/News" rel="news">新闻</a>
        </span>
    </div>
    <div>
        @Scripts.Render("~/bundles/jquery")
        <section>
            @RenderBody()
        </section>
    </div>
    <div class="footer">
        <div class="info">
            <div class="fletr">
                <p><a href="/home/index">首页</a> | <a href="/Freight/zhengche">整车</a> | <a href="/Freight/Vipline">专线</a> | <a href="/Logistics/index">物流公司</a> | <a href="/home/quickrun">快来云APP</a> | <a href="/home/join">加盟</a> | <a href="/home/about">关于我们</a> | <a href="/News/News">新闻</a></p>
                <p class="f12">
                    <span>服务热线：400-8900-666</span>
                    <span>服务邮箱：<a href="mailto:quickrun@163.com">quickrun@163.com</a></span>
                </p>
            </div>

            <span class="twocode">扫码下载快来运APP</span>
        </div>
        <p class="txt">Copyright &copy; 2015 快来运网络科技有限公司 京ICP备14028454号</p>
    </div>
    @Scripts.Render("~/bundles/common")
    <script language="javascript">
    $(document).ready(function () {
        $.ajax({
            url: "/api/AccountApi/checkLogin",
            type: "POST",
            success: function (data) {
                var result = JSON.parse(data);
                if (result.Ok == false) {
                    $("#display").html("<a href=\"\account\\login\">登录</a>");
                    $("#logoutSpan").hide();
                }
                else {
                    $("#display").html("hi," + result.membertype + " - " + result.account + "&nbsp;&nbsp;");
                    $("#logoutSpan").show()
                }
            },
            error: function (xmlHttpRequest, textStatus, errorThrown) {
            }
        });

        $("#logout").click(function () {
            Logout();
        });

        $("span[id='navigate'] a").each(function () {
            if ($(this).attr("rel") == $("#pageName").val()) {
                $(this).attr("class", "on")
            }
            else {
                $(this).attr("class", "")
            }
        });
    });

    function Logout(){
        $.ajax({
            url: "/api/AccountApi/logout",
            type: "POST",
            success: function (data) {
                var result = JSON.parse(data);
                if (result.Ok == true) {
                    $("#display").html("<a href=\"\account\\login\">登录</a>");
                    $("#logoutSpan").hide();
                }
            },
            error: function (xmlHttpRequest, textStatus, errorThrown) {
            }
        });
    }
    </script>
</body>
</html>
